package com.pingan.haofang.searchcloud.index.constants;

import java.util.HashMap;
import java.util.Map;

/**
 * 索引执行类型
 * 
 * @author LUYI374
 * @date May 16, 2017
 * @since 1.0.0
 */
public enum IndexBuildRunType {

    CRON(0, "定时触发"), HANDING(1, "手动触发");

    public final int value;
    public final String desc;

    private static Map<Integer, IndexBuildRunType> MAP = new HashMap<>();

    private IndexBuildRunType(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }


    static {
        for (IndexBuildRunType tmp : IndexBuildRunType.values()) {
            MAP.put(tmp.getValue(), tmp);
        }
    }

    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static IndexBuildRunType get(int id) {
        return MAP.get(id);
    }
}
